﻿using ChoMy.Models;
using ChoMy.Models.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ChoMy.Controllers
{
    public class SettingController : Controller
    {
        private ChoMyContext db = new ChoMyContext();

        public ActionResult GetValueByName(string name)
        {
            Setting setting = db.Settings.FirstOrDefault(x => x.Name == name);

            if (setting != null)
            {
                return Content(setting.Value);
            }

            return null;
        }
    }
}